import java.text.DecimalFormat;


public class Aufgabe1 {
	static DecimalFormat f = new DecimalFormat("#0.00");
/** 
 * 
 * @param b1 Bruttobetrag in 
 * @param p1 Angabe in Prozent
 * @param p2 Angabe in Prozent
 * @return
 */
	public static double mehrwertsteuererhoehung(double b1,double p1,double p2){
		double bruttoDezimal = Double.parseDouble(f.format(b1));
		if (p1<0)
			return -1;
		if (p2<0)
			return -2;
		if (b1<0)
			return -3;
		if (p2<p1)
			return -4;
		if (!(f.equals(b1)))
			return -5;

		else{
			double b2 = bruttoDezimal/(p1/100+1)*(p2/100+1);
			return Double.parseDouble(f.format(b2));
		}
	}
	
	public static void main(String[] args) {
		System.out.println(mehrwertsteuererhoehung(0.59,7,100));

	}

}
